package com.itrip.itripauth.controller;


import com.itrip.itripauth.entity.AreaDic;
import com.itrip.itripauth.service.AreaDicService;
import com.itrip.itripauth.util.Dto;
import com.itrip.itripauth.util.DtoUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 区域字典表 前端控制器
 * </p>
 *
 * @author 四阶段项目二组
 * @since 2020-02-25
 */
@Api("酒店城市")
@RestController
@RequestMapping("/biz/api/hotel")
public class AreaDicController {
   @Autowired
    private AreaDicService areaDicService;
   @ApiOperation("根据type类型，查询国内或国外的热门城市")
    @GetMapping("queryhotcity/{type}")
    public Dto queryhotcity(
            @ApiParam(name = "type",required = true)
            @PathVariable Integer type
    ){
       // ghjhjk
        List<AreaDic> areaDicList = areaDicService.selectByisChina(type,1);
        return DtoUtil.returnDataSuccess(areaDicList);
    }
}
